package com.xuchy.designpattern.factory.simplefactory;

/**
 * @author xuchy
 * @Date 2019/11/5 23:22
 */
public class FoodFactory {
    /**
     * 制作食物
     * @param name 食物名称
     * @return
     */
    public static IFood makeFood(String name) {
        if (name.equals("noodle")) {
            return new Noodle();
        } else if (name.equals("potato")) {
            return new Potato();
        }
        return null;
    }
}
